package com.share.hope.controller;

import com.share.hope.entity.result.R;
import com.share.hope.service.PoorChildCollectService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/share/hope/collect_child")
@RequiredArgsConstructor
@CrossOrigin
@Tag(name = "收藏儿童信息管理接口")
public class PoorChildCollectController {

    private final PoorChildCollectService collectService;

    @GetMapping("/create_collect")
    @Operation(summary = "收藏贫困儿童信息")
    public R<String> createCollect(@RequestParam Long userId, @RequestParam Long childId) {
        return collectService.createCollect(userId, childId);
    }

    @GetMapping("/cancel_collect")
    @Operation(summary = "取消收藏贫困儿童信息")
    public R<String> cancelCollect(@RequestParam Long userId, @RequestParam Long childId) {
        return collectService.cancelCollect(userId, childId);
    }
}
